package main

import "fmt"

//	关键字讲解
//continue 跳出本次循环
//break 跳出整个循环
//return 跳出整个函数

func main() {
	//continue
	for i := 0; i < 6; i++ {
		if i%2 == 0 {
			continue
		}
		fmt.Println(i, "==")
	}

	//break
	k := 1
	for {
		if k <= 6 {
			fmt.Println(k)
		} else {
			fmt.Println("loop done")
			break
		}
		k++
	}

	// return 跳出整个函数
	for i := 5; i < 10; i++ {
		fmt.Println("test return", i)
		if i == 8 {
			return
		}
	}
	fmt.Println("test ends")

}
